summaryrefslogtreecommitdiff
path: root/app/api/auth/[...nextauth]/route.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/api/auth/[...nextauth]/route.ts')
-rw-r--r--app/api/auth/[...nextauth]/route.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts
index 5e4da7ed..4673d8ae 100644
--- a/app/api/auth/[...nextauth]/route.ts
+++ b/app/api/auth/[...nextauth]/route.ts
@@ -25,6 +25,7 @@ declare module "next-auth" {
email?: string | null
image?: string | null
companyId?: number | null
+ techCompanyId?: number | null
domain?: string | null
}
@@ -37,6 +38,7 @@ declare module "next-auth" {
id: string
imageUrl?: string | null
companyId?: number | null
+ techCompanyId?: number | null
domain?: string | null
// 필요한 필드를 추가로 선언 가능
}
@@ -66,6 +68,7 @@ export const authOptions: NextAuthOptions = {
imageUrl: user.imageUrl ?? null,
name: user.name, // DB에서 가져온 실제 이름
companyId: user.companyId, // DB에서 가져온 실제 이름
+ techCompanyId: (user as any).techCompanyId, // techVendor ID
domain: user.domain, // DB에서 가져온 실제 이름
}
},
@@ -123,6 +126,7 @@ export const authOptions: NextAuthOptions = {
// 첫 번째 provider와 동일한 필드 구조 유지
imageUrl: user.imageUrl ?? null,
companyId: user.companyId,
+ techCompanyId: user.techCompanyId,
domain: user.domain
};
}
@@ -149,6 +153,7 @@ export const authOptions: NextAuthOptions = {
token.email = user.email
token.name = user.name
token.companyId = user.companyId
+ token.techCompanyId = user.techCompanyId
token.domain = user.domain
; (token as any).imageUrl = (user as any).imageUrl
}
@@ -162,6 +167,7 @@ export const authOptions: NextAuthOptions = {
name: token.name as string,
domain: token.domain as string,
companyId: token.companyId as number,
+ techCompanyId: token.techCompanyId as number,
image: (token as any).imageUrl ?? null
}
}